package com.cryptoneedle.garden.api;

import com.bubbles.engine.common.core.result.Result;
import com.cryptoneedle.garden.entity.doris.DorisInformationColumn;
import com.cryptoneedle.garden.entity.source.metadata.SourceCatalog;
import com.cryptoneedle.garden.repository.doris.DorisInformationColumnRepository;
import com.cryptoneedle.garden.repository.source.metadata.SourceCatalogRepository;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>description:  </p>
 *
 * @author CryptoNeedle
 * @date 2025-11-13
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @Resource
    private SourceCatalogRepository sourceCatalogRepository;

    @Resource
    private DorisInformationColumnRepository dorisInformationColumnRepository;

    @GetMapping
    public Result<?> test() {
        return Result.success();
    }

    @GetMapping("/multiDatasource")
    public Result<?> multiDatasource() {
        List<SourceCatalog> all = sourceCatalogRepository.findAll();
        List<DorisInformationColumn> all1 = dorisInformationColumnRepository.findAll();
        return Result.success();
    }
}